package com.ityun.ogapp

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import com.ityun.ogapp.utils.TextToSpeechUtils
import com.ven.assists.AssistsCore
import java.lang.ref.WeakReference

class App : Application() {
    companion object {
        private var contextRef: WeakReference<Application>? = null
        val context: Application
            get() = contextRef?.get() ?: throw IllegalStateException("Application not initialized yet")
    }

    override fun onCreate() {
        super.onCreate()
        contextRef = WeakReference(this)
        TextToSpeechUtils.init()
        AssistsCore.init(this)
    }
}